﻿<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="/">
    <html>
      <head>
        <title>Services Inventory</title>
        <style type="text/css" title="currentStyle" media="screen">
          @import "http://www.csszengarden.com/001/001.css";
        </style>

      </head>
      <body>
        <div id="container">
          <div id="intro" style="margin-left:20px">
            <br/>
            <br/>
              <h2>
                <span>Services Inventory</span>
              </h2>            
          </div>
            
          <xsl:for-each select="contract/service">
            <hr/>
            <div style="margin-left:20px">
              <p>
              <h3>
                <xsl:value-of select="@name"/>
              </h3>
              </p>
              <p>
                Namespace: <xsl:value-of select="@xmlNamespace"/>
              </p>
              <p>

                WSDL:
                
                <xsl:element name="a">
                  <xsl:attribute name="href"><xsl:value-of select="@xmlNamespace"/>/Service.svc?wsdl</xsl:attribute>
                  Source
                </xsl:element>,

                <xsl:element name="a">
                  <xsl:attribute name="href">http://services.w3.org/xslt?xslfile=http://tomi.vanek.sk/xml/wsdl-viewer.xsl&amp;xmlfile=<xsl:value-of select="@xmlNamespace"/>/Service.svc?wsdl</xsl:attribute>
                  Formatted
                </xsl:element>,

                <xsl:element name="a">
                  <xsl:attribute name="href">http://www.soapclient.com/soapclient?template=/clientform.html&amp;fn=soapform&amp;SoapTemplate=none&amp;SoapWSDL=<xsl:value-of select="@xmlNamespace"/>/Service.svc?wsdl</xsl:attribute>
                  Client
                </xsl:element>
                
              </p>
              <p>
                <xsl:element name="img">
                  <xsl:attribute name="src">http://yuml.me/diagram/scruffy/class/[<xsl:value-of select="@name"/>|<xsl:for-each select="operations/operation"><xsl:value-of select="@name"/>(request);</xsl:for-each>]<xsl:if test="@extends">->[<xsl:value-of select="../service[@name=current()/@extends]/@name"/>]</xsl:if></xsl:attribute>
                </xsl:element>
              </p>

              <xsl:for-each select="operations/operation">
                <p>
                  <h4>
                    <xsl:value-of select="@name"/>
                  </h4>
                  <div class="wsd" wsd_style="napkin">
                    <pre>
Client-><xsl:value-of select="../../@name"/>: <xsl:value-of select="@name"/> (request)
<xsl:value-of select="../../@name"/>-->Client: response
                    </pre>
                   </div>
                 </p>
              </xsl:for-each>
              

              
            </div>
          </xsl:for-each>
        </div>

        <script type="text/javascript" src="http://websequencediagrams.com/service.js"></script>
        
      </body>
    </html>
    <xsl:apply-templates/>
  </xsl:template>
</xsl:stylesheet>